<template>
	<view>
		<view class="pt100" v-if="!list.length">
			<u-empty mode="order" />
		</view>
		<view v-for="(item,index) in list" :key="index" class="box-shadow radius20 bg-fff mb20 p20"
			@click="$jump('/pages/order/details',{order_id:item.id})">
			<view class="pb14 flex border-b fs26">
				<view class=" color-999">{{item.hospital}}</view>
				<view class="flex1"></view>
				<view class="color-fs">{{item.status_text}}</view>
			</view>
			<view class="pt26 flex">
				<view class="">
					<u-image width="136" height="136" :src="item.image||''" borderRadius="10" />
				</view>
				<view class="ml20 flex1 als-s flex-col row-between">
					<view class="flex ov-h w-max">
						<view class="flex1 fw-w fs30 line-1">{{item.service_name}}</view>
						<view class="color-999 fs24" v-if="item.pay_countdown">
							<text>支付截至:</text>
							<u-count-down :timestamp="item.pay_countdown||0" font-size="26" separator-size="26"
								bg-color="transparent" :show-seconds="true" :color="$fs" :separator-color="$fs" />
						</view>
						<view class="color-999 fs24" v-else-if="item.close_countdown">
							<text>接单截至:</text>
							<u-count-down :timestamp="item.close_countdown||0" font-size="26" separator-size="26"
								bg-color="transparent" :show-seconds="true" :color="$fs" :separator-color="$fs" />
						</view>
						<view class="color-999 fs24" v-else-if="item.trade_countdown">
							<text>转单截至:</text>
							<u-count-down :timestamp="item.trade_countdown||0" font-size="26" separator-size="26"
								bg-color="transparent" :show-seconds="true" :color="$fs" :separator-color="$fs" />
						</view>
					</view>
					<view class="color-666 fs26" v-if="item.expect_time">服务时间：{{item.expect_time}}</view>
					<view class="color-666 fs26" v-if="item.patient">
						<text class="">{{item.patient.name}}</text>
						{{item.patient.relation}}
						{{$list('sex',item.patient.sex)}}
						<text>{{item.patient.age}}岁</text>
					</view>
				</view>
			</view>
			<view class="pt20 flex">
				<view class="color-zs">
					<view class="fw-w  fs30">+￥{{item.master_money}}</view>
					<!-- <view class="fs26" v-if="item.tip_price*1">小费+￥{{item.tip_price}}</view> -->
				</view>
				<view class="flex1"></view>
				<view class="pe-none flex">
					<view class="ml20" v-if="item.status===0">
						<u-button size="mini" type="warning" ripple shape="circle">去支付</u-button>
					</view>
					<view class="ml20"
						v-if="item.status==1&&item.is_trade&&['creator','leader'].includes(item.identity)">
						<u-button size="mini" type="warning" ripple shape="circle">转单</u-button>
					</view>
					<view class="ml20" v-if="item.status==1">
						<u-button size="mini" type="warning" ripple shape="circle">立即接单</u-button>
					</view>
					<view class="ml20" v-if="item.status==2">
						<u-button size="mini" type="warning" ripple shape="circle">开始服务</u-button>
					</view>
					<view class="ml20" v-if="item.status==3">
						<u-button size="mini" type="warning" ripple shape="circle">确认完成</u-button>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "orderList",
		props: {
			list: {
				default: ''
			}
		},
		data() {
			return {
				index: 0
			};
		},
		methods: {
			cancelOrder() {
				// this.$nextTick(()=>{
				// 	uni.$emit('cancelOrder', true)
				// })
				// return
				setTimeout(() => {
					uni.$emit('cancelOrder', true)
				}, 200)
			}
		}
	}
</script>

<style lang="scss">

</style>